package system.data;

import java.util.*;

import framework.core.*;
/*
	Author    :Arrow
	CreateTime:2009-05-14 15:27:41
*/
public class BillMonthIoBase extends Table 
{
public static final String TABLE_NAME = "T_BILL_MONTH_IO";

private static final String BACKUP_TABLE_NAME = "T_BILL_MONTH_IO_BACKUP";

private static final String BACKUP_SEQ_NAME = "S_BILL_MONTH_IO_BACKUP";


public static final String ID = "ID";

public static final String WAREHOUSE_CODE = "WAREHOUSE_CODE";

public static final String WAREHOUSE_NAME = "WAREHOUSE_NAME";

public static final String MONEY_TYPE = "MONEY_TYPE";

public static final String MONEY_IO = "MONEY_IO";

public static final String MONEY = "MONEY";

public static final String MONEY_DATE = "MONEY_DATE";

public static final String CREATE_USER_ID = "CREATE_USER_ID";

public static final String CREATE_USER = "CREATE_USER";

public static final String CREATE_TIME = "CREATE_TIME";


public static Vector m_fields = null;


private String m_id = ""; //序号

private String m_warehouse_code = ""; //仓库编号

private String m_warehouse_name = ""; //仓库名称

private String m_money_type = ""; //费用类别

private String m_money_io = ""; //出入库金额标志

private double m_money = Value.NULL_DOUBLE; //总金额

private String m_money_date = ""; //费用发生日期

private String m_create_user_id = ""; //创建人序号

private String m_create_user = ""; //创建人

private String m_create_time = ""; //创建时间



	public String getId()
	{
	    return m_id;
	}
	public void  setId(String v)
	{
		if(getId().equals(v)) return ;
		m_id = v ;
		markDirty(ID);
	}



	

	public String getWarehouseCode()
	{
	    return m_warehouse_code;
	}
	public void  setWarehouseCode(String v)
	{
		if(getWarehouseCode().equals(v)) return ;
		m_warehouse_code = v ;
		markDirty(WAREHOUSE_CODE);
	}



	

	public String getWarehouseName()
	{
	    return m_warehouse_name;
	}
	public void  setWarehouseName(String v)
	{
		if(getWarehouseName().equals(v)) return ;
		m_warehouse_name = v ;
		markDirty(WAREHOUSE_NAME);
	}



	

	public String getMoneyType()
	{
	    return m_money_type;
	}
	public void  setMoneyType(String v)
	{
		if(getMoneyType().equals(v)) return ;
		m_money_type = v ;
		markDirty(MONEY_TYPE);
	}



	

	public String getMoneyIo()
	{
	    return m_money_io;
	}
	public void  setMoneyIo(String v)
	{
		if(getMoneyIo().equals(v)) return ;
		m_money_io = v ;
		markDirty(MONEY_IO);
	}



	

	public double getMoney()
	{
	    return m_money;
	}
	public void  setMoney(double v)
	{
		if(getMoney()==v) return ;
		m_money = v ;
		markDirty(MONEY);
	}



	

	public String getMoneyDate()
	{
	    return m_money_date;
	}
	public void  setMoneyDate(String v)
	{
		if(getMoneyDate().equals(v)) return ;
		m_money_date = v ;
		markDirty(MONEY_DATE);
	}



	

	public String getCreateUserId()
	{
	    return m_create_user_id;
	}
	public void  setCreateUserId(String v)
	{
		if(getCreateUserId().equals(v)) return ;
		m_create_user_id = v ;
		markDirty(CREATE_USER_ID);
	}



	

	public String getCreateUser()
	{
	    return m_create_user;
	}
	public void  setCreateUser(String v)
	{
		if(getCreateUser().equals(v)) return ;
		m_create_user = v ;
		markDirty(CREATE_USER);
	}



	

	public String getCreateTime()
	{
	    return m_create_time;
	}
	public void  setCreateTime(String v)
	{
		if(getCreateTime().equals(v)) return ;
		m_create_time = v ;
		markDirty(CREATE_TIME);
	}



	



	public String viewId(DBConnection con) throws Exception
	{
		return Value.view(getId());
	}

	public String viewWarehouseCode(DBConnection con) throws Exception
	{
		return Value.view(getWarehouseCode());
	}

	public String viewWarehouseName(DBConnection con) throws Exception
	{
		return Value.view(getWarehouseName());
	}

	public String viewMoneyType(DBConnection con) throws Exception
	{
		return Value.view(getMoneyType());
	}

	public String viewMoneyIo(DBConnection con) throws Exception
	{
		return Value.view(getMoneyIo());
	}

	public String viewMoney(DBConnection con) throws Exception
	{
		return Value.view(getMoney());
	}

	public String viewMoneyDate(DBConnection con) throws Exception
	{
		return Value.view(getMoneyDate());
	}

	public String viewCreateUserId(DBConnection con) throws Exception
	{
		return Value.view(getCreateUserId());
	}

	public String viewCreateUser(DBConnection con) throws Exception
	{
		return Value.view(getCreateUser());
	}

	public String viewCreateTime(DBConnection con) throws Exception
	{
		return Value.view(getCreateTime());
	}



protected BillMonthIoBase()
{
}

public void fill(BillMonthIoPageData pageData) throws Exception
{

	if(pageData.getId()!=null)
	{	
		setId(pageData.getId());
	}

	if(pageData.getWarehouseCode()!=null)
	{	
		setWarehouseCode(pageData.getWarehouseCode());
	}

	if(pageData.getWarehouseName()!=null)
	{	
		setWarehouseName(pageData.getWarehouseName());
	}

	if(pageData.getMoneyType()!=null)
	{	
		setMoneyType(pageData.getMoneyType());
	}

	if(pageData.getMoneyIo()!=null)
	{	
		setMoneyIo(pageData.getMoneyIo());
	}

	if( pageData.getMoney()!=null && 
	   !pageData.getMoney().equals(""))
	{	
		setMoney(Double.parseDouble(pageData.getMoney()));
	}

	if(pageData.getMoneyDate()!=null)
	{	
		setMoneyDate(pageData.getMoneyDate());
	}

	if(pageData.getCreateUserId()!=null)
	{	
		setCreateUserId(pageData.getCreateUserId());
	}

	if(pageData.getCreateUser()!=null)
	{	
		setCreateUser(pageData.getCreateUser());
	}

	if(pageData.getCreateTime()!=null)
	{	
		setCreateTime(pageData.getCreateTime());
	}

}

public String getTableName() 
{
	return TABLE_NAME;
}

public String getBackupTableName() 
{
	return BACKUP_TABLE_NAME;
}

public String getBackupSeqName() 
{
	return BACKUP_SEQ_NAME;
}

public java.util.Vector getFields() 
{
	if(m_fields==null)
	{
		m_fields = new Vector();

		m_fields.add(new Field(ID,Value.TYPE_STRING,true,true,32,"序号"));

		m_fields.add(new Field(WAREHOUSE_CODE,Value.TYPE_STRING,false,true,200,"仓库编号"));

		m_fields.add(new Field(WAREHOUSE_NAME,Value.TYPE_STRING,false,true,100,"仓库名称"));

		m_fields.add(new Field(MONEY_TYPE,Value.TYPE_STRING,false,true,100,"费用类别"));

		m_fields.add(new Field(MONEY_IO,Value.TYPE_STRING,false,true,1,"出入库金额标志"));

		m_fields.add(new Field(MONEY,Value.TYPE_DOUBLE,false,true,0,"总金额"));

		m_fields.add(new Field(MONEY_DATE,Value.TYPE_STRING,false,true,20,"费用发生日期"));

		m_fields.add(new Field(CREATE_USER_ID,Value.TYPE_STRING,false,false,32,"创建人序号"));

		m_fields.add(new Field(CREATE_USER,Value.TYPE_STRING,false,false,100,"创建人"));

		m_fields.add(new Field(CREATE_TIME,Value.TYPE_STRING,false,false,20,"创建时间"));
		
	}
	return m_fields;
}

public void initObject(java.sql.ResultSet rs) throws Exception
{

	m_id = getString(rs,ID);

	m_warehouse_code = getString(rs,WAREHOUSE_CODE);

	m_warehouse_name = getString(rs,WAREHOUSE_NAME);

	m_money_type = getString(rs,MONEY_TYPE);

	m_money_io = getString(rs,MONEY_IO);

	m_money = getDouble(rs,MONEY);

	m_money_date = getString(rs,MONEY_DATE);

	m_create_user_id = getString(rs,CREATE_USER_ID);

	m_create_user = getString(rs,CREATE_USER);

	m_create_time = getString(rs,CREATE_TIME);

	ms_new_flag = ConstDefine.NO;
}

public Value get(String f)
{

	if(f.equalsIgnoreCase(ID))
	{
		return new Value(getId());
	}

	if(f.equalsIgnoreCase(WAREHOUSE_CODE))
	{
		return new Value(getWarehouseCode());
	}

	if(f.equalsIgnoreCase(WAREHOUSE_NAME))
	{
		return new Value(getWarehouseName());
	}

	if(f.equalsIgnoreCase(MONEY_TYPE))
	{
		return new Value(getMoneyType());
	}

	if(f.equalsIgnoreCase(MONEY_IO))
	{
		return new Value(getMoneyIo());
	}

	if(f.equalsIgnoreCase(MONEY))
	{
		return new Value(getMoney());
	}

	if(f.equalsIgnoreCase(MONEY_DATE))
	{
		return new Value(getMoneyDate());
	}

	if(f.equalsIgnoreCase(CREATE_USER_ID))
	{
		return new Value(getCreateUserId());
	}

	if(f.equalsIgnoreCase(CREATE_USER))
	{
		return new Value(getCreateUser());
	}

	if(f.equalsIgnoreCase(CREATE_TIME))
	{
		return new Value(getCreateTime());
	}
	
	return null;
}
public void set(String f,Value v) throws Exception
{

	if(f.equalsIgnoreCase(ID))
	{
		setId(v.getString());
	}

	if(f.equalsIgnoreCase(WAREHOUSE_CODE))
	{
		setWarehouseCode(v.getString());
	}

	if(f.equalsIgnoreCase(WAREHOUSE_NAME))
	{
		setWarehouseName(v.getString());
	}

	if(f.equalsIgnoreCase(MONEY_TYPE))
	{
		setMoneyType(v.getString());
	}

	if(f.equalsIgnoreCase(MONEY_IO))
	{
		setMoneyIo(v.getString());
	}

	if(f.equalsIgnoreCase(MONEY))
	{
		setMoney(v.getDouble());
	}

	if(f.equalsIgnoreCase(MONEY_DATE))
	{
		setMoneyDate(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_USER_ID))
	{
		setCreateUserId(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_USER))
	{
		setCreateUser(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_TIME))
	{
		setCreateTime(v.getString());
	}
	
}
public String toString()
{
	String msg = "BillMonthIo=\n";
	msg += "(\r\n";

	msg += "    序号(id)="+get("id")+"\r\n";

	msg += "    仓库编号(warehouse_code)="+get("warehouse_code")+"\r\n";

	msg += "    仓库名称(warehouse_name)="+get("warehouse_name")+"\r\n";

	msg += "    费用类别(money_type)="+get("money_type")+"\r\n";

	msg += "    出入库金额标志(money_io)="+get("money_io")+"\r\n";

	msg += "    总金额(money)="+get("money")+"\r\n";

	msg += "    费用发生日期(money_date)="+get("money_date")+"\r\n";

	msg += "    创建人序号(create_user_id)="+get("create_user_id")+"\r\n";

	msg += "    创建人(create_user)="+get("create_user")+"\r\n";

	msg += "    创建时间(create_time)="+get("create_time")+"\r\n";
		
	msg += ")\r\n";
	return msg;
}
public void copyBase(BillMonthIoBase srcObj)
{

	setWarehouseCode(srcObj.getWarehouseCode());

	setWarehouseName(srcObj.getWarehouseName());

	setMoneyType(srcObj.getMoneyType());

	setMoneyIo(srcObj.getMoneyIo());

	setMoney(srcObj.getMoney());

	setMoneyDate(srcObj.getMoneyDate());

	setCreateUserId(srcObj.getCreateUserId());

	setCreateUser(srcObj.getCreateUser());

	setCreateTime(srcObj.getCreateTime());

}

public String toXml() throws Exception
{
	String xml = "";
	xml += "<BillMonthIo>";

	xml += "<Id>"+Value.view(getId())+"</Id>";

	xml += "<WarehouseCode>"+Value.view(getWarehouseCode())+"</WarehouseCode>";

	xml += "<WarehouseName>"+Value.view(getWarehouseName())+"</WarehouseName>";

	xml += "<MoneyType>"+Value.view(getMoneyType())+"</MoneyType>";

	xml += "<MoneyIo>"+Value.view(getMoneyIo())+"</MoneyIo>";

	xml += "<Money>"+Value.view(getMoney())+"</Money>";

	xml += "<MoneyDate>"+Value.view(getMoneyDate())+"</MoneyDate>";

	xml += "<CreateUserId>"+Value.view(getCreateUserId())+"</CreateUserId>";

	xml += "<CreateUser>"+Value.view(getCreateUser())+"</CreateUser>";

	xml += "<CreateTime>"+Value.view(getCreateTime())+"</CreateTime>";
	
	xml += "</BillMonthIo>";
	return xml;
}

}
